package com.kfm.pm;

import java.util.Objects;

public class Game {

    private String name;
    private int star;
    private int price;

    public Game(String name, int star, int price) {
        this.name = name;
        this.star = star;
        this.price = price;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getStar() {
        return star;
    }

    public void setStar(int star) {
        this.star = star;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "Game{" +
                "name='" + name + '\'' +
                ", star=" + star +
                ", price=" + price +
                '}';
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        Game game = (Game) object;
        return star == game.star && Double.compare(price, game.price) == 0 && Objects.equals(name, game.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, star, price);
    }
}
